package models

// package main

import (
	"github.com/astaxie/beego/orm"
	_ "github.com/go-sql-driver/mysql"
//	"time"
)

// 用户信息
type Role struct {
	Id          	int64
	RoleName		string
	AccountId   	int64
	CreateTime	 	int64
	FirstLoginDate	int64
}

// 物品表信息
type Item struct {
	Id          	int64
	timestamp		string
	pid   			int64
	AccId	 		int64
	RoleId			int64
	Level			int64
	ItemId			int64
	ActionId		int64
	ConsumeCount	int64
	RecordTime		int64
	SellType		int64
}


func (*Role) TableEngine() string {
	return engine()
}
func (*Item) TableEngine() string {
	return engine()
}

func engine() string {
	return "INNODB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci"
}

func init() {
	//orm.RegisterModelWithPrefix("", new(Role))
	orm.RegisterModel(new(Role), new(Item))
}

// func main() {
// 	orm.RegisterDataBase("default", "mysql", "root:@/beego_blog?charset=utf8&loc=Asia%2FShanghai", 30, 200)
// 	orm.RunCommand()
// }
